package main

import (
	"fmt"
	"math"
)

func main() {
	var list [][]int = [][]int{[]int{1,1},[]int{3,4},[]int{-1,0}}
	res := minTimeToVisitAllPoints(list)
	fmt.Println(res)
}


func minTimeToVisitAllPoints(points [][]int) int {
	var count float64 = 0
	 ax:= points[0][0]
	 ay := points[0][1]

	for  i := 1; i < len(points); i++{
		bx := points[i][0]
		by := points[i][1]
		count += math.Max(math.Abs(float64(ax - bx)), math.Abs(float64(ay - by)))
		ax = bx
		ay = by
	}
	return int(count)
}